<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class club_model extends CI_Model {

    public function __construct() {
        parent::__construct();
    }

    function menu() {
        $this->load->library('menus');
        $menu = new menus;
        $data['menu'] = $menu->show_menu();

        return $data;
    }
 
    function get_all_club() {
        $this->db->select('*');
        $query = $this->db->get('tbl_club');

        return $query->result_array();
    }

    function get_club($clubid) {
        $query = $this->db->get_where('tbl_club', array('clubID' => $clubid));
        return $query->row_array();
    }

    public function insert_club($data) {
        $this->db->insert('tbl_club', $data);

        $id = $this->db->insert_id();

        return (isset($id)) ? $id : FALSE;
    }

    public function update_club($clubid, $data) {
        $this->db->where('clubID', $clubid);

        return $this->db->update('tbl_club', $data);
    }

     

}
